package com.justgame.project.service.api.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.justgame.project.cloud.common.constant.Const;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;


@Data
public class JustGameScore implements Serializable {
    private final static long serialVersionUID = Const.V;

    /**
     * 主键id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Null
    private String id;

    @NotBlank
    private String gameId;

    @Null
    private String sysUserId;

    @NotNull
    @Max(value = 5)
    @Min(value = 1)
    private Integer score;

    @JsonIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Null
    private LocalDateTime time;

}
